﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace XmlDatabase.Core
{
    internal class XBufferManager
    {
        private static Dictionary<String, XBufferManager> instances = new Dictionary<String, XBufferManager>();
        private XBufferManager() { }
        /// <summary>
        /// 单例
        /// </summary>
        /// <param name="db"></param>
        /// <returns></returns>
        public static XBufferManager GetInstance(String db)
        {
            if (!XBufferManager.instances.Keys.Contains<String>(db))
            {
                XBufferManager.instances.Add(db, new XBufferManager());
            }
            return instances[db];
        }
    }
}
